<extend name="public@base"/>
block(name='main')
    .wrap.js-check-wrap
        ul.nav.nav-tabs(role="tablist")
            li.nav-item: a.nav-link.active(href!="{:url('link/index')}") 所有友情链接
            li.nav-item: a.nav-link(href!="{:url('link/add')}") 添加友情链接
        form.js-ajax-form.margin-top-20(method='post', action="{:url('Link/listOrder')}")
            .table-actions.btn-group.mb-1
                button.btn.btn-sm.btn-primary.js-ajax-submit(type='submit') {:lang('SORT')}
                button.btn.btn-sm.btn-success.js-ajax-submit(type='submit', data-action!="{:url('link/toggle',array('display'=>1))}", data-subcheck='true') {:lang('DISPLAY')}
                button.btn.btn-sm.btn-danger.js-ajax-submit(type='submit', data-action!="{:url('link/toggle',array('hide'=>1))}", data-subcheck='true') {:lang('HIDE')}
            php $status=array("1"=>lang('DISPLAY'),"0"=>lang('HIDDEN'));
            table.table.table-hover.table-bordered.table-list
                thead
                    tr
                        th
                            label
                                input.js-check-all(type='checkbox', data-direction='x', data-checklist='js-check-x')
                        th {:lang('SORT')}
                        th ID
                        th {:lang('NAME')}
                        th 链接地址
                        th {:lang('STATUS')}
                        th {:lang('ACTIONS')}
                tbody
                    <foreach name="links" item="vo">
                    tr
                        td
                            input.js-check(type='checkbox', data-yid='js-check-y', data-xid='js-check-x', name='ids[]', value='{$vo.id}')
                        td
                            input.input.input-order.mr5(name='list_orders[{$vo.id}]', type='text', size='3', value='{$vo.list_order}')
                        td {$vo.id}
                        td {$vo.name}
                        td
                            a(href='{$vo.url}', target='_blank') {$vo.url}
                        td
                            empty(name='vo.status')
                                span.badge.badge-secondary {$status[$vo['status']]}
                                <else/>
                                span.badge.badge-success {$status[$vo['status']]}
                        td
                            a.btn.btn-sm.btn-primary.mr-1(href!="{:url('link/edit',array('id'=>$vo['id']))}") {:lang('EDIT')}
                            a.btn.btn-sm.btn-danger(href!="{:url('link/delete',array('id'=>$vo['id']))}") {:lang('DELETE')}
                    </foreach>
                tfoot
                    tr
                        th
                            label
                                input.js-check-all(type='checkbox', data-direction='x', data-checklist='js-check-x')
                        th {:lang('SORT')}
                        th ID
                        th {:lang('NAME')}
                        th 链接地址
                        th {:lang('STATUS')}
                        th {:lang('ACTIONS')}
            .table-actions.btn-group
                button.btn.btn-sm.btn-primary.js-ajax-submit(type='submit') {:lang('SORT')}
                button.btn.btn-sm.btn-success.js-ajax-submit(type='submit', data-action!="{:url('link/toggle',array('display'=>1))}", data-subcheck='true')
                    | {:lang('DISPLAY')}
                button.btn.btn-sm.btn-danger.js-ajax-submit(type='submit', data-action!="{:url('link/toggle',array('hide'=>1))}", data-subcheck='true')
                    | {:lang('HIDE')}
